package com.lkwlw.tplms.order.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.lkwlw.tplms.order.dao.mapper.OrderinfoMapper;
import com.lkwlw.tplms.order.dao.model.Orderinfo;
import com.lkwlw.tplms.order.dao.model.OrderinfoExample;
import com.opensymphony.xwork2.ActionSupport;

public class AddOrderManageAction extends ActionSupport {
	private static final long serialVersionUID = -5673389745577318833L;
	private Orderinfo order;
	private OrderinfoMapper orderInfoDAO;
	private List<Orderinfo> orderList;
	private String selectIds;
	
	public String execute(){
		if (null != selectIds && !"".equals(selectIds)) {
			order = orderInfoDAO.selectByPrimaryKey(selectIds);			
			if(order.getState().equals("未收件")){
				return SUCCESS;
			}
		}		
		orderList = orderInfoDAO.selectByExample(null,new OrderinfoExample());
		return ERROR;
	}
	
	public Orderinfo getOrder() {
		return order;
	}

	public void setOrder(Orderinfo order) {
		this.order = order;
	}

	public OrderinfoMapper getOrderInfoDAO() {
		return orderInfoDAO;
	}

	public void setOrderInfoDAO(OrderinfoMapper orderInfoDAO) {
		this.orderInfoDAO = orderInfoDAO;
	}

	public List<Orderinfo> getOrderList() {
		return orderList;
	}

	public void setOrderList(List<Orderinfo> orderList) {
		this.orderList = orderList;
	}

	public String getSelectIds() {
		return selectIds;
	}

	public void setSelectIds(String selectIds) {
		this.selectIds = selectIds;
	}	

}
